/***    
request.globalRequest(url,请求方式,obj数据,123,true单,true 多array)url, method, data, power, isUpload, isFiles
1===没登录前的请求头
2===携带请求头token
3===刷新token
***/
import request from '@/util/request/request.ts'
const apiOrder={}
//创建工单 
apiOrder.saveUserOrder = (data) => request.globalRequest({url:`/mobile/user/order/saveUserOrder`,  method:'POST',data,power:2})
// 服务进度-根据工单ID获取工单列表详情
apiOrder.getOrderDetail = (workId) => request.globalRequest({url:`/mobile/user/order/getOrderDetail/`+workId, method:'get',power:2})
// 获取工单列表
apiOrder.OrderList = (data) => request.globalRequest({url:`/mobile/user/order/getOrderList`, method:'POST',data,power:2})
// 服务进度-获取工单状态数量
apiOrder.getOrderStatusQty = (data) => request.globalRequest({url:`/mobile/user/order/getOrderStatusQty`, method:'post',data,power:2})
// 服务进度-获取工单列表详情的服务进度
apiOrder.getOrderDetailServiceLog = (data,workId) => request.globalRequest({url:`/mobile/user/order/getOrderDetailServiceLog/`+workId, method:'post',data,power:2})
// 服务进度-获取工单列表详情的商品信息
apiOrder.getOrderDetailGoodsInfo = (workId) => request.globalRequest({url:`/mobile/user/order/getOrderDetailGoodsInfo/`+workId, method:'get',power:2})
// 服务进度-获取工单列表详情的工单信息
apiOrder.getOrderDetailOrderInfo = (workId) => request.globalRequest({url:`/mobile/user/order/getOrderDetailOrderInfo/`+workId, method:'get',power:2})
// 服务进度-获取工单列表详情的服务商信息
apiOrder.getOrderDetailNetworkInfo = (workId) => request.globalRequest({url:`/mobile/user/order/getOrderDetailNetworkInfo/`+workId, method:'get',power:2})
//服务进度-获取工单列表详情的客户信息
apiOrder.getOrderDetailUserInfo = (workId) => request.globalRequest({url:`/mobile/user/order/getOrderDetailUserInfo/`+workId, method:'get',power:2})

// 服务进度-取消服务工单
apiOrder.cancelOrder = (workId) => request.globalRequest({url:`/mobile/user/order/cancelOrder/`+workId, method:'put',power:2})
// 服务进度-改约日期时间
apiOrder.updateExpectedTime = (data) => request.globalRequest({url:`/mobile/user/order/updateExpectedTime`, method:'put',data,power:2})

// 获取报单模块列表
apiOrder.getOrderModuleList = (data,factoryId='') => request.globalRequest({url:`/mobile/select/getOrderModuleList?factoryId=${factoryId}`, method:'post',data,power:2})
// 工单报单-扫码报单，获取编码信息
apiOrder.getUserOrderCodeInfo = (data) => request.globalRequest({url:`/mobile/user/code/getUserOrderCodeInfo`, method:'get',data,power:2})
// 根据模块ID获取工单自定义字段
apiOrder.getModuleField = (moduleId) => request.globalRequest({url:`/mobile/select/getModuleField/${moduleId}`, method:'get',power:2})

// 历史工单报单-历史工单列表
apiOrder.getUserHistoryOrder = (data) => request.globalRequest({url:`/mobile/user/order/getUserHistoryOrder`, method:'post',data,power:2})
// 历史工单报单-历史工单列表详情
apiOrder.getUserHistoryOrderDetail = (workId) => request.globalRequest({url:`/mobile/user/order/getUserHistoryOrderDetail/`+workId, method:'get',power:2})
// 历史工单报单-历史工单商品信息
apiOrder.getUserHistoryOrdeGoods = (data,workId) => request.globalRequest({url:`/mobile/user/order/getUserHistoryOrdeGoods/`+workId, method:'post',data,power:2})
// 历史工单报单-历史工单商品编码信息
apiOrder.getUserHistoryOorderGoodsCodes = (workId) => request.globalRequest({url:`/mobile/user/order/getUserHistoryOorderGoodsCodes/`+workId, method:'get',power:2})
// 历史工单报单-获取历史工单申请售后的商品
apiOrder.userHistoryOrderApplySale = (workId) => request.globalRequest({url:`/mobile/user/order/userHistoryOrderApplySale/`+workId, method:'get',power:2})
//获取工单报单的自定义字段
apiOrder.getUserOrderModuleField = (moduleId) => request.globalRequest({url:`/mobile/user/order/getUserOrderModuleField/`+moduleId,method: 'get',power:2})
//根据工单模块ID获取模块信息
apiOrder.getWorkModule = (moduleId) => request.globalRequest({url:`/mobile/select/getWorkModule/${moduleId}`,method: 'get',power:2})
// 根据商品ID&商品规格ID获取商品信息
apiOrder.getGoodsInfo = (goodsId,goodsSpecId) => request.globalRequest({url:`/mobile/select/getGoodsInfo/${goodsId}/${goodsSpecId}`,method: 'get',power:2})
export default apiOrder